package com.condlist.model;


import java.util.List;

public class CarCondListService {

	private CarCondListDAO_interface dao;

	public CarCondListService() {
		dao = new CarCondListDAO();
	}

	public CarCondListVO addCarCondList( Integer value, String driver_path_id,
			String rider_path_id, String cond_id) {

		CarCondListVO carcondlistVO = new CarCondListVO();

	
		carcondlistVO.setValue(value);
		carcondlistVO.setDriver_path_id(driver_path_id);
		carcondlistVO.setRider_path_id(rider_path_id);
		carcondlistVO.setCond_id(cond_id);
		dao.insert(carcondlistVO);

		return carcondlistVO;
	}

	public CarCondListVO updateCarCondList( Integer value, String driver_path_id,
			String rider_path_id, String cond_id) {

		CarCondListVO carcondlistVO = new CarCondListVO();

		
		carcondlistVO.setValue(value);
		carcondlistVO.setDriver_path_id(driver_path_id);
		carcondlistVO.setRider_path_id(rider_path_id);
		carcondlistVO.setCond_id(cond_id);
		dao.update(carcondlistVO);

		return carcondlistVO;
	}

	public void deleteCarCondList(String driver_path_id) {
		dao.delete(driver_path_id);
	}

	public CarCondListVO getOneCarCondList(String driver_path_id) {
		return dao.findByPrimaryKey(driver_path_id);
	}

	public List<CarCondListVO> getAll() {
		return dao.getAll();
	}
}
